/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package mygame.model.highscore;

import com.thoughtworks.xstream.annotations.XStreamAlias;

/**
 *
 * @author tommy
 */

@XStreamAlias("highscore")
public class HighScore implements Comparable<HighScore> {
    @XStreamAlias("score")
    private int score;
    
    @XStreamAlias("player")
    private String player;
    
    public HighScore () {
    }
    
    public HighScore (String player, int score) {
        this.score = score;
        this.player = player;
    }
    

    public String getPlayer() {
        return player;
    }

    public void setPlayer(String player) {
        this.player = player;
    }

    public int getScore() {
        return score;
    }

    public void setScore(int score) {
        this.score = score;
    }

    public int compareTo(HighScore t) {
        return this.score - t.score;
    }

    @Override
    public String toString() {
        return player + "   ---   " + score;
    }
    
    
}
